package com.john.http.core.convert;

import com.john.http.core.util.NumUtil;


/**
 * 〈一句话功能简述〉<br/>
 * 〈功能详细描述〉
 *
 * @author jiangguangtao on 2016/4/28.
 */
public class RegexpDoubleValueConverter implements IValueConverter {
    private Double defaultVal = null;

    public RegexpDoubleValueConverter(Double defaultVal) {
        this.defaultVal = defaultVal;
    }

    @Override
    public String getName() {
        return "浮点数转换";
    }

    @Override
    public Object convert(String str) {
        return NumUtil.regexParseDouble(str, defaultVal);
    }
}
